home *** CD-ROM | disk | FTP | other *** search
- /* atexit.c --- BIBLE pp. 76-77 */
- #include <stdio.h>
- #include <stdlib.h>
- main(int argc, char **argv)
- {
- atexit_t first, second, third;
- atexit(first);
- atexit(second);
- atexit(third);
- printf("Now exiting...\n");
- }
- /* ------------------------------- */
- atexit_t first(void)
- {
- printf("Function number 1: called last\n");
- }
- /* --------------------------------- */
- atexit_t second(void)
- {
- printf("Function number 2:\n");
- }
- /* --------------------------------- */
- atexit_t third(void)
- {
- printf("Function number 3: called first\n");
- }
- /* --------------------------------- */